﻿Imports System.Data.SqlClient
Imports System.IO
Public Class clsBiometria
    Private mintIdBiometria As Integer
    Private mstrCodigo As String
    Private mimgHuella As PictureBox
    Public Property Codigo() As String
        Get
            Return mstrCodigo
        End Get
        Set(ByVal value As String)
            mstrCodigo = value
        End Set
    End Property
    Public Sub New()
        mstrCodigo = ""
    End Sub
    Public Sub Insertar()

        Dim sql As String = "Insert Into Biometria (" & _
                            "Codigo)" & _
                            " VALUES (" & _
                            "@Codigo)"

        Dim cnConn As New SqlConnection
        cnConn.ConnectionString = CitraConnection

        Dim Command As New SqlCommand(sql, cnConn)

        Command.Parameters.AddWithValue("Codigo", mstrCodigo)

        cnConn.Open()
        Dim RowsAffected As Integer = Command.ExecuteNonQuery

        If RowsAffected > 0 Then
            cnConn.Close()
        Else
            MsgBox("No fue posible insertar el registro", MsgBoxStyle.Exclamation, "Aviso")
            If cnConn.State = ConnectionState.Open Then
                cnConn.Close()
            End If
        End If

    End Sub
End Class
